package com.code.base.dic.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.dic.persistence.DicAccTypeMapper;
import com.code.base.dic.pojo.DicAccType;
import com.code.util.PrimaryKeyUtil;


@Service
public class DicAccTypeService {


	@Resource
	private DicAccTypeMapper dicAccTypeMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public DicAccType getDataById(Long id) {
		return dicAccTypeMapper.getDataById(id);
	}

	public List<DicAccType> getAllData() {
		return dicAccTypeMapper.getAllData();
	}

	public int getDataCountByCondition(DicAccType entity) {
		return dicAccTypeMapper.getDataCountByCondition(entity);
	}

	public List<DicAccType> getDataByCondition(DicAccType entity) {
		return dicAccTypeMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(DicAccType entity) {
		return dicAccTypeMapper.getDataCountByLikeCondition(entity);
	}

	public List<DicAccType> getDataByLikeCondition(DicAccType entity) {
		return dicAccTypeMapper.getDataByLikeCondition(entity);
	}

	public List<DicAccType> getDataByIds(Long[] ids) {
		return dicAccTypeMapper.getDataByIds(ids);
	}

	public void insertData(DicAccType entity) {
		insertData(entity, true);
	}

	public void insertData(DicAccType entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		dicAccTypeMapper.insertData(entity);
	}

	public void updateData(DicAccType entity) {
		dicAccTypeMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		dicAccTypeMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(DicAccType entity) {
		dicAccTypeMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		dicAccTypeMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		dicAccTypeMapper.deleteDataByIds(ids);
	}

}
